<?php
  include("user_info.inc");
  $sql = 'select * from file where file.user_ID='.$_GET['user_id'].' and file.type=\'d\';';
  $result = mysql_query($sql) or die('Query failed3: ' . mysql_error());
  mysql_close($link);
?>
<td valign="top" class="style3">
<span  align="center">
  <table align="center" class="style2"  width="550">
    <tr>
      <th>ID</th>
      <th>File name</th>
      <th>Delete</th>
      <th>Edit</th>
    </tr>
<?php
  //EVERY link, which link back to its page self, in this page should contant 'user_id'
  while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
    echo "<tr>\n\t<td>";
    echo $line['file_ID'];
    echo "</td>\n<td>";
    echo "<a href=\"".$line['file'];
    echo "\">".$line['file_name']."</a>";
    echo "</td><td><a Onclick=\"if(!confirm('Do you want to delete?')) return false;\" href=\"";
    echo $_SERVER['PHP_SELF'].'?file_id='.$line['file_ID'].'&user_id='.$line['user_ID']; 
    echo "\">delete</a></td>\n<td><a href=\"edit_file?file_id=".$line['file_ID']."\"> Edit </a></td> ";
  }
?>

    <tr>
      <td></td><td></td><td></td><td align="center"><a href="add_file.php?user_id=<?php echo $_GET['user_id'];?>">Add</a></td>
    </tr>
  </table>
</span>
</td>
</tr>
</table>
<br /><br />
